﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class inc_channelImg : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        init();
    }
    void init()
    {
        String channel = "";
        if (Request["channel"] != null && Request["channel"].Trim().Length > 0)
        {
            channel = Request["channel"].Trim();
        }
        else if (Request["id"] != null && Request["id"].Trim().Length > 0)
        {
            //提取信息所属栏目页面位置
            DataTable dt = NewDao.findChanelByNewId(Request["id"].Trim());
            if (dt != null && dt.Rows.Count > 0)
            {
                channel = dt.Rows[0]["pageLocation"].ToString();
            }
        }
        if (channel != null && channel.Trim().Length > 0)
        {
            DataTable channelDt = ChannelDao.findByPL(channel);
            if (channelDt != null && channelDt.Rows.Count > 0)
            {
                String img = channelDt.Rows[0]["img"].ToString();
                if (!img.Equals(""))
                {
                    channelImg.Text = "<div class=\"sub_banner\"><img src=\""+img+"\"  /></div>";
                }
            }
        }
    }
}
